﻿using System;
using System.Collections.Generic;
using System.Text;
using XCore.Languages;

namespace SaaS.Core.Localization.Languages
{
    public class LanguageTranslateBase : XmlFileLocalizationSource, ILanguageTranslate
    {
        public LanguageTranslateBase() : base(typeof(LanguageTranslateBase).Assembly, "SaaS.Core.Localization.Languages", "Languages")
        {

        }

        public string GetString(string name, LanguageType language)
        {
            return this.Dictionaries[name][language];
        }

        public string GetString(string name, LanguageType language, params string[] arg)
        {
            return string.Format(this.Dictionaries[name][language], arg);
        }

        public IDictionary<LanguageType, string> GetStrings(string name)
        {
            return this.Dictionaries[name];
        }
    }
}
